home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
amok_lha
/
amok32.lha
/
TestBild
/
txt
/
Screen.mod
< prev
next >
Wrap
Text File
|
1993-08-15
|
4KB
|
130 lines
(*--------------------------------------------------------------------------
:Program. Menu.mod
:Author. Andreas Lüdtke
:Address. Stangestraße 11, D 2000 Hamburg 50
:Phone. 040/3905153
:History. V1.0, 01-Jan-90, Andreas Lüdtke
:Copyright. PD © Andreas Lüdtke 1990.
:Language. Modula-2
:Translator. M2Amiga 3.3d
:Contents. Implementationsmodul zur Initialisierung des Screens
:Contents. und des Windows des Testbildprogramms
---------------------------------------------------------------------------*)
IMPLEMENTATION MODULE Screen;
FROM Arts IMPORT Assert, TermProcedure;
FROM SYSTEM IMPORT ADR, ADDRESS;
FROM Intuition IMPORT WindowFlags, NewWindow, IDCMPFlags, IDCMPFlagSet,
WindowFlagSet, WindowPtr, ScreenPtr, customScreen, NewScreen,
OpenWindow, OpenScreen, IntuiText, IntuiTextPtr,
ScreenFlags, ScreenFlagSet, CloseScreen, CloseWindow;
FROM Graphics IMPORT SetRGB4, ViewModes, ViewModeSet, RastPortPtr,
jam2, ViewPortPtr, DrawModes, DrawModeSet, Move, Draw, SetAPen, RectFill,
WritePixel, TextAttrPtr;
CONST
PLANES = 4; (* Anzahl Screen-Planes *)
Titel = " Testbildgenerator V1.0 vom 01.01.90 handmade by A.Lüdtke";
VAR
Fenster : NewWindow;
Schirm : NewScreen;
PROCEDURE SetColors( sp : ScreenPtr);
VAR
vpptr : ViewPortPtr;
BEGIN
vpptr := ADR(sp^.viewPort);
SetRGB4( vpptr, 0, 0, 0, 0);
SetRGB4( vpptr, 1, 15, 15, 15);
(* Die Farbregister 2..9 werden durch andere Prozeduren gesetzt,siehe Menu *)
SetRGB4( vpptr, 10, 8, 6, 4);
SetRGB4( vpptr, 11, 3, 3, 3);
SetRGB4( vpptr, 12, 6, 6, 6);
SetRGB4( vpptr, 13, 10, 10, 10);
SetRGB4( vpptr, 14, 0, 0, 0);
SetRGB4( vpptr, 15, 15, 15, 15);
END SetColors;
PROCEDURE InitText( fP : INTEGER;
bP : INTEGER;
lE : INTEGER;
tE : INTEGER;
VAR Text : IntuiText;
TextAdr : ADDRESS);
BEGIN
WITH Text DO
frontPen := fP; backPen := bP;
drawMode := jam2; leftEdge := lE;
topEdge := tE; iTextFont := NIL;
iText := TextAdr; nextText := NIL;
END;
END InitText;
PROCEDURE OpenScreenAndWindow (VAR sp : ScreenPtr;
VAR wp : WindowPtr;
intlace : BOOLEAN);
BEGIN
wp := NIL;
sp := NIL;
WITH Schirm DO
leftEdge := 0; topEdge := 0;
width := 640;
IF intlace THEN
height := 2*Hoehe;
ELSE
height := Hoehe;
END;
depth := PLANES; detailPen := 1;
blockPen := 0; viewModes := ViewModeSet{hires};
IF intlace THEN INCL(viewModes,lace) END;
type := customScreen + ScreenFlagSet{screenBehind};
font := NIL; defaultTitle := ADR(Titel);
gadgets := NIL; customBitMap := NIL
END;
sp := OpenScreen( Schirm );
Assert(sp#NIL,ADR("Testbild: Screen konnte nicht geöffnet werden"));
SetColors( sp);
WITH Fenster DO
leftEdge := 0; topEdge := 0;
width := Breite; title := NIL;
IF intlace THEN
height := 2*Hoehe;
ELSE
height := Hoehe;
END;
detailPen := 0; blockPen := 1;
flags := WindowFlagSet{ activate, borderless, backDrop};
idcmpFlags := IDCMPFlagSet { menuPick};
type := customScreen; checkMark := NIL;
firstGadget := NIL; screen := sp;
bitMap := NIL; minWidth := 0;
minHeight := 0; maxWidth := 0;
maxHeight := 0;
END;
wp := OpenWindow( Fenster);
Assert(wp#NIL,ADR("Testbild: Kein Platz für Fenster"));
END OpenScreenAndWindow;
PROCEDURE CloseScreenAndWindow (VAR sp : ScreenPtr;
VAR wp : WindowPtr);
BEGIN
IF wp # NIL THEN
CloseWindow( wp);
wp := NIL;
END;
IF sp # NIL THEN
CloseScreen( sp);
sp := NIL;
END;
END CloseScreenAndWindow;
END Screen.mod